package com.gitee.wsl.android.ui.theme.local

import android.graphics.Color
import com.gitee.wsl.common.ui.theme.local.SampleColorPalette

/**
 * Returns the [Color] for the given shade of the [SampleColorPalette].
 */
operator fun SampleColorPalette.get(shade: Double): Color {
    val colorLong = when (shade) {
        50.0 -> this.`50`
        100.0 -> this.`100`
        200.0 -> this.`200`
        300.0 -> this.`300`
        400.0 -> this.`400`
        500.0 -> this.`500`
        600.0 -> this.`600`
        700.0 -> this.`700`
        800.0 -> this.`800`
        900.0 -> this.`900`
        else -> this.`900`
    }
    return Color.valueOf(colorLong)
}
